package com.bskj.kuaifu.nettyService.service.utils;

import io.netty.channel.ChannelHandlerContext;
import io.netty.util.AttributeKey;

/**
 * Created by Qzy on 2016/1/29.
 * 客户端连接的封装类
 */

public class ClientConnection {
	public static AttributeKey<String> NETID = AttributeKey.valueOf("netId");
	
	private String netId;
	private ChannelHandlerContext ctx;
	private String boxNo;
	
	ClientConnection(ChannelHandlerContext ctx){
		this.ctx = ctx;
		this.netId = ctx.toString();
		this.ctx.attr(ClientConnection.NETID).set(this.netId);
	}

	public String getNetId() {
		return netId;
	}

	public void setNetId(String netId) {
		this.netId = netId;
	}

	public ChannelHandlerContext getCtx() {
		return ctx;
	}

	public void setCtx(ChannelHandlerContext ctx) {
		this.ctx = ctx;
	}

	public String getBoxNo() {
		return boxNo;
	}

	public void setBoxNo(String boxNo) {
		this.boxNo = boxNo;
	}
}
